'''
Created on May 14, 2014

@author: rockyrock

Math utilities funtions
'''

import numpy as np
from numpy import linalg as LA

def logistic_function(x):
    return 1.0 / (1.0 + np.exp(-x))

def norm(x):
    return LA.norm(x)

def descent_step(W, W_grad, alpha):
    W = W - (alpha * W_grad)
    return W